function checkUserNo(userNo){
	var reg = /^[0-9a-zA-Z]+$/;
	if(!reg.test(userNo)){
		return false;
	}else{
		return true;
	}
}

function checkMobile(phone) {//只查手机号
	var re = /^(0|86|17951)?(13[0-9]|15[012356789]|17[01678]|18[0-9]|14[57])[0-9]{8}$/;
	if(phone==''){
		return true;
	}else if (re.test(phone)) {
		return true;
	} else {
		return false;
	}
}

function checkEmail(str){
	var re = /^(\w-*\.*)+@(\w-?)+(\.\w{2,})+$/;
	if(str==''){
		return true;
	}else if(re.test(str)){
		return true;
	}else{
		return false;
	}
}

function checkTel(tel) {
	var re = /^(0\d{2,3}-\d{7,8})(-\d{1,4})?$/;//只查固定电话 不要改为手机和固话合并
	if(tel==''||tel==null){
		return true;
	}else if (re.test(tel)) {
		return true;
	} else {
		return false;
	}
}

function checkPwd(pwd){
	// 由数字、26个英文字母或者下划线组成的字符串 6-16个字符
	var reg=/^\w{6,16}$/;
	if(pwd==''){
		return true;
	}else if(reg.test(pwd)){
		return true;
	}else{
		return false;
	}
}

function checkName(name){
	 //请输入中文、数字和英文,正则表达式
	 var reg = new RegExp("^[A-Za-z0-9\u4e00-\u9fa5]+$");
	 if(name==''){
		 return true;
	 }else if(!reg.test(name)){
		 return false;
	 }else{
		 return true;
	 }
}

function checkBusinessName(){
	var reg = /[@#\$%\^&\*]+/g ;
	alert(/[@#\$%\^&\*]+/g.test("%wo"));
}

function compareDate(date1,date2){
    var oDate1 = new Date(date1);
    var oDate2 = new Date(date2);
    if(oDate1.getTime() > oDate2.getTime()){
        console.log('第一个大');
        return 1;
    } else {
        console.log('第二个大');
        return 2;
    }
}

function isFloat(num){
	var reg=/^(([0-9]+\.[0-9]*[1-9][0-9]*)|([0-9]*[1-9][0-9]*\.[0-9]+)|([0-9]*[1-9][0-9]*))$/;　　//正浮点数
	if(reg.test(num)){
		return true;
	}else{
		console.log('不是数字');
		return false;
	}
}

function defaultValue(cbtid,defVal,defText){  

    var combotree =$("#"+cbtid);  

    var tree = combotree.combotree('tree');  

    var defNode = tree.tree("find",defVal);  

    if(!defNode){  

        tree.tree('append', {  

            data: [{  

                id: defVal,  

                text: defText  

            }]  

        });  

        defNode = tree.tree("find",defVal);  

        //console.log(defNode);  

        //console.log(combotree);  

        combotree.combotree('setValue',defVal);  

        tree.tree('select',defNode.target);  

        defNode.target.style.display='none';  

    }else{  

        combotree.combotree('setValue',defVal);  

    }
}

function setBtnDisable(id) {
	$("#" + id).css({'background-color' : 'gray'});
	$("#" + id).attr("disabled", true);
}

function setBtnEnable(id) {
	$("#" + id).attr("disabled", false);
}

function loadingProgress(){
	$.messager.progress({
		title: '提示',
		msg: '数据请求中，请稍候……',
		text: ''
	});
}

function closeProgress() {
	$.messager.progress('close');
}

function ajaxLoading(){
	$("<div class=\"datagrid-mask\"></div>").css({display:"block",width:"100%",height:$(window).height()}).appendTo("body");
	$("<div class=\"datagrid-mask-msg\"></div>").html("正在处理，请稍候。。。").appendTo("body").css({display:"block",left:($(document.body).outerWidth(true) - 190) / 2,top:($(window).height() - 45) / 2});
}

function ajaxLoadEnd(){
	$(".datagrid-mask").remove();
	$(".datagrid-mask-msg").remove();
}

var SqProjectType = new Object();
SqProjectType.common=1;
SqProjectType.coop=2;

var ApprovalType={
				sq:1,
				jf:2,
				yf:3
			};
